package com.zlf.command;

import com.zlf.command.impl.BuyStock;
import com.zlf.command.impl.SellStock;

/**
 * 使用Broker类来接收和执行命令
 */
public class CommandPatternDemo {
		public static void main(String[] args) {
				Stock abcStock = new Stock();

				BuyStock buyStockOrder = new BuyStock(abcStock);
				SellStock sellStockOrder = new SellStock(abcStock);

				Broker broker = new Broker();
				//添加调用实现
				broker.takeOrder(buyStockOrder);
				broker.takeOrder(sellStockOrder);

				broker.placeOrders();
		}
}